/**
 * Created by YGD on 2017/2/26.
 */
module.exports = function ($state,$modal) {
    return {
        set:function(key,value){
            try{
                localStorage.setItem(key,JSON.stringify(value));
                return true
            }
            catch (error){
                return false
            }

        },
        get:function(key){
            return JSON.parse(localStorage.getItem(key));
        },
        remove:function(key){
            localStorage.removeItem(key)
        }
    }

};